﻿namespace WayneGameSolution.Communicate
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Runtime.CompilerServices;
    using WayneGameSolution.Packs;

    public interface ILink
    {
        event PackReceivedEventHandler PackReceived;

        event EventHandler PackSent;

        event EventHandler   LinkClosing;
        event EventHandler LinkClosed;

        void SendPack(IEnumerable<IDataPack> packs);
        void SendPack(params IDataPack[] packs);

        ICrypt Cryptography { get; set; }

        int InboxCount { get; }

        DateTime LastDataTime { get; }

        int OutboxCount { get; }

        ICodec PackCodec { get; set; }

        LinkStatus Status { get; set; }

        int TimeoutSecond { get; }



    }
    public delegate void PackReceivedEventHandler(IDataPack inbox);

    public delegate void PackSentEventHandler(int PackNum);
      public delegate void LinkClosingEventHandler();

    public enum LinkStatus
    {
        Disconnected,
        Ready,
        Busy,
        TimingOut,
        Timeout
    }

}

